---
title: Configuration.replaceStreamStart()
api: Configuration.replaceStreamStart
---

## Description

<Summary/>

<FilterDiagram
  name="replaceStreamStart"
  input="Event"
  output="Event"
/>

The user function will receive as parameter the first event in the input stream. The event will be removed from the stream. Whatever the function returns will be inserted into the output stream in place of the removed event. It can be an event or a [Message](/reference/api/Message), or an array of events or _Messages_. If the function returns nothing (_null_ or _undefined_), no events will be inserted back into the stream.

You can also use a fixed replacement value instead of a function if the replacement is static.

## Syntax

``` js
pipy()
  .pipeline()
  .replaceStreamStart(
    event => transform(event)
  )
```

## Parameters

<Parameters/>

## See Also

* [Configuration](/reference/api/Configuration)
* [replaceStreamEnd()](/reference/api/Configuration/replaceStreamEnd)
* [replaceMessageStart()](/reference/api/Configuration/replaceMessageStart)
* [replaceMessageBody()](/reference/api/Configuration/replaceMessageBody)
* [replaceMessageEnd()](/reference/api/Configuration/replaceMessageEnd)
* [replaceMessage()](/reference/api/Configuration/replaceMessage)
* [replaceData()](/reference/api/Configuration/replaceData)
